<!--
* description: 车型配置弹出框
* author: luojx
* createdDate: 2019-08-02
-->
<template>
  <section class="carTypeConfig">
    <el-dialog
      v-dialogDrag
      title="成员选择"
      :visible.sync="curPopupsVisible"
      width="1000px"
      center
      @close="sendCode"
      :close-on-click-modal="false"
      :append-to-body="true"
    >
      <dialogHeader slot="title" :title="'成员选择'" :styleType="$store.state.app.dialogType"></dialogHeader>
      <one-table-template
        ref="multipleTable"
        :dynamicButtons="tableButtons"
        :dynamicComponents="tableComponents"
        :dynamicApiConfig="apiConfig"
        :dynamicTableCols="tableCols"
        :dynamicFormFields="formField"
        :dynamicIsShowSelect="isMul"
      />
    </el-dialog>
  </section>
</template>
<script>
import { oneTableWithViewTemplateMixins } from "@/components/mixins/oneTableWithViewTemplateMixins";
import { valueObjectMixins } from "@/components/mixins/valueObjectMixins";
import { orgApis } from "@/api/apiList/org";
import { crmApis } from "@/api/apiList/crm";
import OneTableTemplate from "@/components/crm/commonComponents/crmPopupsOneTable";

export default {
  // 组件混入对象：{data[listQuery] methods[queryTable]}
  mixins: [oneTableWithViewTemplateMixins, valueObjectMixins],
  components: {
    OneTableTemplate,
    dialogHeader: () => import("@/components/dialogHeader") //弹窗标题
  },
  data() {
    return {
      // 网格查询API配置对象
      apiConfig: orgApis.mdmOrgEmployeeQueryFindAll,
      // 动态组件-按钮
      tableButtons: [
        {
          compKey: "btnKey1",
          type: "primary",
          size: "small",
          clickEvent: () => this.queryTable(1),
          text: "查询",
          position: "top"
        }, //查询
        {
          compKey: "btnKey3",
          type: "primary",
          size: "small",
          clickEvent: () => this.sendCode("empId", "userName"),
          text: "确认",
          position: "bottom"
        }, //确认
        {
          compKey: "btnKey2",
          type: "",
          size: "small",
          clickEvent: () => this.reset(),
          text: "重置",
          position: "top"
        } //重置
      ],
      // 动态组件-查询条件
      tableComponents: [],
      // 静态组件-查询条件
      staticTableComponents: [
        // 显示组件
        {
          compKey: "compKey2",
          labelName: this.$t("org.label.department") /*部门*/,
          codeField: "deptId",
          textField: "deptName",
          component: () => import("@/components/org/orgName/orgNameInput"),
          type: "propus",
          isMust: true,
          isRequire: true
        },
        {
          compKey: "compKey3",
          labelName: this.$t("org.label.UserName") /*用户名称*/,
          codeField: "userName",
          component: () => import("@/components/org/commonInput"),
          type: "inputText",
          isMust: true
        },
        {
          compKey: "compKey4",
          labelName: this.$t("org.label.employeeName") /*员工姓名*/,
          codeField: "empName",
          component: () => import("@/components/org/commonInput"),
          type: "inputText",
          isMust: true
        }
        // {
        //   compKey: "compKey5",
        //   labelName: this.$t("org.label.PositionCode") /*系统岗位编码*/,
        //   codeField: "positionCode",
        //   component: () => import("@/components/org/commonInput"),
        //   type: "inputText",
        //   isMust: true,
        //   hidden: true
        // }
      ],
      // 动态生成网格列
      tableCols: [],
      // 静态生成网格列
      staticTableCols: [
        {
          prop: "dlrShortName",
          label: this.$t("org.label.dlrName") /*经销商*/,
          width: null,
          align: "center"
        },
        {
          prop: "orgName",
          label: this.$t("org.label.department") /*部门*/,
          width: null,
          align: "center"
        },
        {
          prop: "userName",
          label: this.$t("org.label.UserName") /*用户名称*/,
          width: null,
          align: "center"
        },
        {
          prop: "empName",
          label: this.$t("org.label.employeeName") /*员工姓名*/,
          width: null,
          align: "center"
        },
        {
          prop: "empId",
          label: this.$t("org.label.empId") /*员工ID*/,
          width: 80,
          align: "center",
          hidden: true
        }
      ],
      //表单查询数据（查询条件）
      formField: {
        deptId: "",
        userName: "",
        empName: ""
        //positionCode: ""
      }
    };
  }
};
</script>
